<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>MSc Dissertation: rtrl.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">MSc Dissertation
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">rtrl.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="rtrl_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#ifndef RTRL_H</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define RTRL_H</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;selforg/matrix.h&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;selforg/controller_misc.h&gt;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="keyword">using namespace </span>matrix;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keyword">using namespace </span>std;</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="code" href="classRTRL.html">   27</a></span>&#160;<span class="keyword">class </span><a class="code" href="classRTRL.html">RTRL</a> {</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;   <a class="code" href="classRTRL.html">RTRL</a>(<span class="keywordtype">int</span> num_Sensors, <span class="keywordtype">int</span> num_Motors);</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classRTRL.html">RTRL</a>();</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    </div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keywordtype">void</span> setDesiredOut (Matrix fut_sensor);</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keywordtype">void</span> setState(Matrix motors);</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    </div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;     Matrix predict();</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;     </div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;     Matrix getModelMatrix (Matrix input);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;     </div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="classRTRL.html#aef2f207bf3fbd5c021c38ac47c43df1b">   78</a></span>&#160;    <span class="keywordtype">double</span> <a class="code" href="classRTRL.html#aef2f207bf3fbd5c021c38ac47c43df1b">learningRate</a>; </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    </div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    Matrix simulateNet();</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    </div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keywordtype">void</span> getNodeSensitivity(Matrix updatedNodes,Matrix nodesValue);</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">double</span> squash(<span class="keywordtype">double</span> node);</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    </div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">double</span> squash_derivative(<span class="keywordtype">double</span> node);</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keywordtype">void</span> updateWeights(Matrix updatedNodes);</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    </div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keywordtype">int</span> kronneckerDelta (<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> k);</div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="code" href="classRTRL.html#ab8432648bd198b508d3df70795a2e530">  125</a></span>&#160;    Matrix <a class="code" href="classRTRL.html#ab8432648bd198b508d3df70795a2e530">nodeState</a>;  </div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="classRTRL.html#aacf8aed7c8db184aac677b92cfb897c0">  126</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classRTRL.html#aacf8aed7c8db184aac677b92cfb897c0">numInputNodes</a>; </div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="code" href="classRTRL.html#a7efbd35c2dc8ce128d90beca0a48cfcb">  127</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classRTRL.html#a7efbd35c2dc8ce128d90beca0a48cfcb">numReservoirNodes</a>; </div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="classRTRL.html#a8812c0b19a5dcf8bd60358eb2943ca5a">  128</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classRTRL.html#a8812c0b19a5dcf8bd60358eb2943ca5a">numOutputNodes</a>;  </div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="classRTRL.html#a008e08ccdfed2dc91d136f43def827f1">  130</a></span>&#160;    Matrix <a class="code" href="classRTRL.html#a008e08ccdfed2dc91d136f43def827f1">outputState</a>; </div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="code" href="classRTRL.html#ada2be9a65806afca86c8b74ec4043800">  131</a></span>&#160;    Matrix <a class="code" href="classRTRL.html#ada2be9a65806afca86c8b74ec4043800">weights</a>;     </div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="classRTRL.html#a37638ae70d7bbd0b03aa5c1b3ce55d47">  133</a></span>&#160;    vector &lt;Matrix&gt; <a class="code" href="classRTRL.html#a37638ae70d7bbd0b03aa5c1b3ce55d47">nodeSensitivity</a>; </div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="code" href="classRTRL.html#a7c5691d2b26a3297c7b5502c1e5cbba3">  134</a></span>&#160;    Matrix <a class="code" href="classRTRL.html#a7c5691d2b26a3297c7b5502c1e5cbba3">desiredSens</a>; </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;};</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="preprocessor">#endif  </span><span class="comment">/* RTRL_H */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Aug 14 2013 17:48:49 for MSc Dissertation by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
